﻿using NewDevice.RS232;
using NewDevice.RS485;
using NewDevice.USB;
using NewDevice.XiWei;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using Common;

namespace IP20.Procdure
{
    internal class Global
    {
        //        static Global()
        //        {
        //#if JQ8931314
        //            IsJq8931314 = Visibility.Visible;
        //#endif
        //        }

        public static bool MacFull { get; set; } = true;

        /// <summary>
        /// 指示是否是JQ8931314机种
        /// </summary>
        public static Visibility IsJq8931314 { get; set; } = Visibility.Collapsed;

        public const string Jq1314ConfigFile = "Jq89313_Jq89314.xlsx";

        public static ExcelTool Jq1314Config { get; set; } = new();

        public static bool IsLogin { get; set; }
        public static UserEntity User { get; set; }
        public static UserEntity EditUser { get; set; }

        public static UserControl UCHome { get; set; }
        public static UserControl UCDebug { get; set; }
        public static UserControl UCUserManage { get; set; }

        public static bool IsBusy { get; set; }
        public static bool IsConfigChanged { get; set; } = true;

        public static Action UserChangeAction { get; set; }

        /// <summary>
        /// 急停信号,急停触发为True
        /// </summary>
        public static bool IsEmgStopSingal;

        /// <summary>
        /// 安全光栅信号,触发为True
        /// </summary>
        public static bool IsSafeDoorSingal;

        #region device

        /// <summary>
        /// 机种名
        /// </summary>
        public static string ProductName { get; set; }

        public static string JFlashExePath { get; set; }
        public static List<string> ListJLinkSN { get; set; } = new();
        public static List<IT6302> ListIT6302 { get; set; } = new();
        public static List<ZS_AnalogInput> ListVoltageCards { get; set; } = new();
        public static List<ZS_AnalogInput> ListCurrentCards { get; set; } = new();
        public static List<RU_12_3040> ListRUPower { get; set; } = new();
        public static List<DL3021A> ListDL3021A { get; set; } = new();

        public static List<PQW_IO> List16ChPQW { get; set; } = new();
        public static List<PQW_IO> List8ChPQW { get; set; } = new();

        public static List<XiWeiFlash> ListXiWeiFlash { get; set; } = new();

        public static JX1000 JX1000 { get; set; } = new();
        public static ZS_TemperatureCard TempCard { get; set; }

        public static List<IP20Factory> IP20Factorys = new();

        public static List<string> IP20Ports = new();

        #endregion device

        //public static AutoResetEvent IP20FlashEvent;
    }
}